package evocarcassonne.tileseteditor.ui.swing.panels.zones;

import evocarcassonne.core.board.locations.Zone;
import evocarcassonne.core.utils.Card;
import java.awt.Component;

public class MeadowPanel extends javax.swing.JPanel {

    public MeadowPanel() {
        initComponents();
    }

    public MeadowPanel(Zone zone) {

        this();
        this.zone = zone;

        title = "Meadow";
        switch (zone.card) {
            case Card.N:
                title += " - North";
                break;
            case Card.E:
                title += " - East";
                break;
            case Card.S:
                title += " - South";
                break;
            case Card.W:
                title += " - Ouest";
                break;
        }
    }

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        optionsZone = new javax.swing.JPanel();
        optionsGroup = new javax.swing.JPanel();

        optionsZone.setBorder(javax.swing.BorderFactory.createTitledBorder("optionsZone"));

        javax.swing.GroupLayout optionsZoneLayout = new javax.swing.GroupLayout(optionsZone);
        optionsZone.setLayout(optionsZoneLayout);
        optionsZoneLayout.setHorizontalGroup(
            optionsZoneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 368, Short.MAX_VALUE)
        );
        optionsZoneLayout.setVerticalGroup(
            optionsZoneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 103, Short.MAX_VALUE)
        );

        optionsGroup.setBorder(javax.swing.BorderFactory.createTitledBorder("optionsGroup"));

        javax.swing.GroupLayout optionsGroupLayout = new javax.swing.GroupLayout(optionsGroup);
        optionsGroup.setLayout(optionsGroupLayout);
        optionsGroupLayout.setHorizontalGroup(
            optionsGroupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 368, Short.MAX_VALUE)
        );
        optionsGroupLayout.setVerticalGroup(
            optionsGroupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(optionsZone, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(optionsGroup, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(optionsZone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(optionsGroup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(31, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JPanel optionsGroup;
    private javax.swing.JPanel optionsZone;
    // End of variables declaration//GEN-END:variables

    public String getParentTitle() {
        return title;
    }
    Zone zone;
    String title;

    public void enabledGroupOptions(boolean b) {

        optionsGroup.setEnabled(b);

        for (Component comp : optionsGroup.getComponents()) {
            comp.setEnabled(b);
        }
    }
}
